﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Bizbase.Repository;
using Bizbase.Domain.Security;
using Bizbase.DependencyInjection;

namespace Bizbase.Services.Security
{
    class DefaultSecurityManager : ISecurityManager
    {
        #region ISecurityManager 成员

        public bool Login(string name, string password)
        {
            return name == password ? true : false;
        }

        public void Logout()
        {
 
        }

        public void Testing()
        {
            //创建数据库
            //IDatabase database = Ioc.GetService<IDatabase>();
            //database.BuildDatabase();

            //新增用户
            //User user = new Domain.Security.User();
            //user.Id = 1;
            //user.Name = "zzhai";

            IRepository<User> repository = Resolver.GetService<IRepository<User>>();
            //repository.Save(user);

            int i = repository.Find("Name", "zzhai")[0].Id;
        }

        #endregion
    }
}
